package method

import (
	"net/http"
	"server/base"
	"server/biz"
	"server/service"
)

func MockJs(md *service.Meta, w http.ResponseWriter) {
	p := md.Get("p").String()
	w.Header().Set("Conetnt-Type", "application/javascript; charset=utf-8")
	var out string
	sysvtab := biz.SysvTab(p)
	out += "var SYSVTAB = " + base.JsonString(sysvtab) + ";\n"
	hddtab := biz.HddTab(p)
	out += "var HDDTAB = " + base.JsonString(hddtab) + ";\n"
	gentab := biz.GenTab(p)
	out += "var GENTAB = " + base.JsonString(gentab) + ";\n"
	gametab := biz.GameTab(p)
	out += "var GAMETAB = " + base.JsonString(gametab) + ";\n"
	vertab := biz.VersionTab(p)
	out += "var VERTAB = " + base.JsonString(vertab) + ";\n"
	pkgtab := biz.PkgTab(p)
	out += "var PKGTAB = " + base.JsonString(pkgtab) + ";\n"
	w.Write([]byte(out))
}
